import { p, g, d, put } from '@/utils/request';

//小程序登录
export function weChatGetOpenId(code){
	return p('/app/entrance/weChatGetOpenId',{code:code});
}
//小程序获取手机号
export function getPhoneNumber(encryptedData,iv,sessionKey){
	return p('/app/entrance/getPhoneNumber',{encryptedData:encryptedData,iv:iv,sessionKey:sessionKey});
}
//微信注册
export function registered(avatarUrl,gender,nickName,openid,parentUserId,tel,unionId){
	return p('/app/entrance/registered',{avatarUrl:avatarUrl,gender:gender,nickName:nickName,openid:openid,parentUserId:parentUserId,tel:tel,unionId:unionId})
}
//商铺列表
export function getShopList(latitude,longitude){
	return p('/app/shop/list',{latitude:latitude,longitude:longitude});
}
//添加员工
export function addStaff(employeesId,employeesImag,employeesName,employeesType,tel){
	return p('/app/employees/add',{employeesId:employeesId,employeesImag:employeesImag,employeesName:employeesName,employeesType:employeesType,tel:tel});
}
//展示员工列表
export function showStaffList(keywords,pageNumber,pageSize){
	return p('/app/employees/list',{keywords:keywords,pageNumber:pageNumber,pageSize:pageSize});
}
//根据员工id查询员工信息
export function showStaffInfoById(id){
	return p('/app/employees/getById',{id:id});
}
//删除员工
export function delStaff(id){
	return p('/app/employees/delete',{id:id});
}
//添加、修改产品
export function addProduct(employeeIds,productId,productImages,productName,productPrice,productShelves){
	return p('/app/product/add',{employeeIds:employeeIds,productId:productId,productImages:productImages,productName:productName ,productPrice:productPrice,productShelves:productShelves});
}
//展示产品列表
export function showProductList(keywords,pageNumber,pageSize){
	return p('/app/product/list',{keywords:keywords,pageNumber:pageNumber,pageSize:pageSize});
}
//根据产品id查询员工列表
export function showStaffListById(pageNumber,pageSize,productId){
	return p('/app/employees/findListByProductId',{pageNumber:pageNumber,pageSize:pageSize,productId:productId});
}
//营业时间列表
export function showshopTime(employeesId,shopId){
	return p('/app/shop/shopTimeList',{employeesId:employeesId,shopId:shopId});
}
//营业时间
export function businessTime(employeesId,shopId,timeStr){
	return p('/app/shop/getShopTime',{employeesId:employeesId,shopId:shopId,timeStr:timeStr});
}
//获取员工服务的所有产品
export function employeeList(employeeId,shopId){
	return p('/app/product/employeeList',{employeeId:employeeId,shopId:shopId});
}
// //支付查询用户下是否有会员卡
export function getCard(productId,shopId){
	return p('/app/vip/getProductCard',{productId:productId,shopId:shopId});
}
//微信支付
export function muiWxPay(subject,total,transactionId){
	return p('/app/wxpay/muiWxPay',{subject:subject,total:total,transactionId:transactionId});
}
//发起支付
export function toPay(payId,payWhat){
	return p('/app/pay/toPay',{payId:payId,payWhat:payWhat});
}
//单个添加订单
export function addOrder(employeesId,productId,shopId,time){
	return p('/app/order/add',{employeesId:employeesId,productId:productId,shopId:shopId,time:time});
}
//获取订单列表
export function orderList(isShop,pageNumber,pageSize,status){
	return p('/app/order/findList', {isShop:isShop,pageNumber:pageNumber,pageSize:pageSize,status:status})
}
//取消订单
export function cancelOrder(isShop,orderId){
	return p('/app/order/cancelOrder', {isShop:isShop,orderId:orderId})
}
//完成订单
export function accomplishOrder(orderId){
	return p('/app/order/accomplish', {orderId:orderId})
}
//根据商户ID查询商户下员工
export function findByShopId(shopId){
	return p('/app/employees/findByShopId', {shopId:shopId})
}
//修改营业状态
export function businessStatusSwitch(){
	return p('/app/shop/businessStatusSwitch', {})
}
//会员卡购买
export function vipCardPay(orderId,purchaseRecordId){
	return p('/app/pay/vipCardPay', {orderId:orderId,purchaseRecordId:purchaseRecordId})
}
//好友列表
export function sharePage(){
	return p('/app/user/sharePage', {})
}
//广告图管理
export function shopBannerUpdate(imgs,type){
	return p('/app/shop/shopBannerUpdate', {imgs:imgs,type:type})
}
//获取小程序码
export function getCode(page,scene,width){
	return p('/app/entrance/getWxAppCodeUnLimit', {page:page,scene:scene,width:width})
}
//查询管理端会员卡
export function findManageCard(){
	return p('/app/vip/findManageCard',{});
}
//查询店铺信息
export function getShopByUserId(data){
	return p('/app/shop/getShopByUserId',data);
}
//获取验证码
export function sendMessages(data){
	return p('/app/user/sendMessages', data)
}
//入驻店铺提交信息审核
export function shopadd(data){
	return p('/app/shop/add', data)
}
//新增或修改会员卡
export function vipadd(data){
	return p('/app/vip/add',data);
}
//可使用产品
export function showProductList1(){
	return p('/app/product/list',{});
}
//获取用户会员卡
export function findUserCard(data){
	return p('/app/vip/findUserCard', data);
}
//会员卡上下架修改
export function shelvesManagement(data){
	return p('/app/vip/shelvesManagement', data)
}
//绑定银行卡
export function bankadd(data){
	return p('/app/bank/add', data);
}
//查询商家银行卡列表
export function bankfindList(data){
	return p('/app/bank/findList', data);
}
//银行卡解绑
export function bankdelete(data){
	return p ('/app/bank/delete', data);
}
//查询余额
export function userBalance(data){
	return p('/app/money/userBalance', data);
}
//账单明细
export function moneylist(data){
	return p('/app/money/list', data)
}
//提现
export function withdrawalBalance(data){
	return p('/app/money/withdrawalBalance', data)
}
//用户购买会员卡
export function buyVipCard(data){
	return p('/app/vip/buyVipCard', data)
}
//用户取消会员卡支付
export function cancelPayVip(data){
	return p('/app/vip/cancelPayVip', data)
}
//支付查询用户下是否有会员卡
export function getProductCard(data){
	return p('/app/vip/getProductCard', data)
}

//删除会员卡
export function vipdelete(data){
	return p('/app/vip/delete', data)
}

//提现余额token
export function getRepeatToken(data){
	return p('/app/money/getRepeatToken', data)
}
//账单统计
export function moneygetSum(data){
	return p('/app/money/getSum', data)
}
//获取会员卡下所有ID
export function vipCardServiceProducts(data){
	return p('/app/product/vipCardServiceProducts',data)
}